package com.workstudy.workstudy.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.workstudy.workstudy.mapper.WorkstudyPostMapper;
import com.workstudy.workstudy.domain.WorkstudyPost;
import com.workstudy.workstudy.service.IWorkstudyPostService;
import com.workstudy.common.core.text.Convert;

/**
 * 岗位Service业务层处理
 * 
 * @author ws
 * @date 2021-03-28
 */
@Service
public class WorkstudyPostServiceImpl implements IWorkstudyPostService 
{
    @Autowired
    private WorkstudyPostMapper workstudyPostMapper;

    /**
     * 查询岗位
     * 
     * @param postId 岗位ID
     * @return 岗位
     */
    @Override
    public WorkstudyPost selectWorkstudyPostById(Long postId)
    {
        return workstudyPostMapper.selectWorkstudyPostById(postId);
    }

    /**
     * 查询岗位列表
     * 
     * @param workstudyPost 岗位
     * @return 岗位
     */
    @Override
    public List<WorkstudyPost> selectWorkstudyPostList(WorkstudyPost workstudyPost)
    {
        return workstudyPostMapper.selectWorkstudyPostList(workstudyPost);
    }

    /**
     * 新增岗位
     * 
     * @param workstudyPost 岗位
     * @return 结果
     */
    @Override
    public int insertWorkstudyPost(WorkstudyPost workstudyPost)
    {
        return workstudyPostMapper.insertWorkstudyPost(workstudyPost);
    }

    /**
     * 修改岗位
     * 
     * @param workstudyPost 岗位
     * @return 结果
     */
    @Override
    public int updateWorkstudyPost(WorkstudyPost workstudyPost)
    {
        return workstudyPostMapper.updateWorkstudyPost(workstudyPost);
    }

    /**
     * 删除岗位对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWorkstudyPostByIds(String ids)
    {
        return workstudyPostMapper.deleteWorkstudyPostByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除岗位信息
     * 
     * @param postId 岗位ID
     * @return 结果
     */
    @Override
    public int deleteWorkstudyPostById(Long postId)
    {
        return workstudyPostMapper.deleteWorkstudyPostById(postId);
    }

    @Override
    public int updateWorkstudyPostAppr(WorkstudyPost workstudyPost) {
        return workstudyPostMapper.updateWorkstudyPostAppr(workstudyPost);
    }

    @Override
    public List<WorkstudyPost> selectWorkstudyPostByAnnouncerBy(String announcerBy) {
        return workstudyPostMapper.selectWorkstudyPostByAnnouncerBy(announcerBy);
    }
}
